﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.MobileControls;
using System.Web.UI.WebControls;
using DLV.Data.Entities;
using DLV.FrameWork;
using DLV.Utilities;
using DLV.Library.Utilities;
using Label = System.Web.UI.WebControls.Label;

namespace DLV.BackEnd.Controls
{
    public partial class RequesInfor : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //LoadNational();
        }

        #region khách hàng
        //public void LoadGvKhachHang(int indexPage)
        //{
        //    CustomersInfo info = new CustomersInfo();
        //    info.CusFullName = txtCusFullName.Text;
        //    info.CusCode = txtCusCode.Text;
        //    info.CusPhone = txtCusPhone.Text;
        //    info.CusEmail = txtCusEmail.Text;
        //    info.CusAddress = txtCusAddress.Text;
        //    info.CusGender = Convert.ToInt32(RadioButtonList1.SelectedValue);
        //    info.CusNationalId = Convert.ToInt32(ddlCusNationalId.SelectedValue);
        //    info.CusGender = Convert.ToInt32(RadioButtonList1.SelectedValue);
        //    info.CusNotes = txtCusNotes.Text;
        //    info.CusStatus = 0;
        //    List<CustomersInfo> list = new CustomersController().ListCustomersSearch(info);
        //    DataTable tb = CBO.ConvertToDataTable(list, typeof(CustomersInfo));
        //    GvPhanTrang(tb, ref GridView2, 20, indexPage);
        //}
        
        //private void LoadNational()
        //{
        //    ddlCusNationalId.DataSource = new NationalController().ListNational();
        //    ddlCusNationalId.DataTextField = "NationalName";
        //    ddlCusNationalId.DataValueField = "NationalId";
        //    ddlCusNationalId.DataBind();

        //    ddlCusNationalId.Items.Insert(0, new ListItem("--- Chọn quốc gia ---", "0"));
        //}
        //public Boolean GvPhanTrang(DataTable tb, ref GridView gv, int SoTrang, int TrangHienTai)
        //{
        //    try
        //    {

        //        gv.DataSource = tb;
        //        gv.AllowPaging = true;
        //        gv.PageIndex = TrangHienTai;
        //        gv.PageSize = SoTrang;
        //        gv.DataBind();
        //        return true;
        //    }
        //    catch
        //    {
        //        return false;
        //    }
        //}
        protected void ChangedGgRequest(object sender, EventArgs e)
        {
            //LoadGvKhachHang(0);
        }
        //protected void bntSaveUpd_Click(object sender, EventArgs e)
        //{
        //    CustomersInfo info = new CustomersController().GetCustomers(Convert.ToInt32(txtCusId1.Text));
        //    info.CusFullName = txtCusFullName.Text;
        //    info.CusCode = txtCusCode.Text;
        //    info.CusPhone = txtCusPhone.Text;
        //    info.CusEmail = txtCusEmail.Text;
        //    info.CusDateofBirth = txtCusDateOfBirth.Text;
        //    info.CusAddress = txtCusAddress.Text;
        //    info.CusGender = Convert.ToInt32(RadioButtonList1.SelectedValue);
        //    info.CusNationalId = Convert.ToInt32(ddlCusNationalId.SelectedValue);
        //    info.CusGender = Convert.ToInt32(RadioButtonList1.SelectedValue);
        //    info.CusNotes = txtCusNotes.Text;
        //    //info.CusUpdatedBy = UserId;
        //    info.CusUpdatedDate = DateTime.Now;
        //    info.CusStatus = 0;
        //    new CustomersController().UpdateCustomers(info);
        //    Response.Redirect("CusRequest.aspx");
        //}
        //protected void bntSaveIns_Click(object sender, EventArgs e)
        //{
        //    CustomersInfo info = new CustomersInfo();
        //    info.CusFullName = txtCusFullName.Text;
        //    info.CusCode = txtCusCode.Text;
        //    info.CusPhone = txtCusPhone.Text;
        //    info.CusEmail = txtCusEmail.Text;
        //    info.CusAddress = txtCusAddress.Text;
        //    info.CusDateofBirth = txtCusDateOfBirth.Text;
        //    info.CusGender = Convert.ToInt32(RadioButtonList1.SelectedValue);
        //    info.CusNationalId = Convert.ToInt32(ddlCusNationalId.SelectedValue);
        //    info.CusGender = Convert.ToInt32(RadioButtonList1.SelectedValue);
        //    info.CusNotes = txtCusNotes.Text;
        //    info.CusCreatedBy = 0;
        //    info.CusCreatedDate = DateTime.Now;
        //    info.CusStatus = 0;
        //    new CustomersController().InsertCustomers(info);
        //    Response.Redirect("CusRequest.aspx");

        //}
        //protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e)
        //{
        //    Label txtMa = (Label)(GridView2.Rows[e.RowIndex].FindControl("lbMa"));
        //    new CustomersController().DeleteCustomers(Convert.ToInt32(txtMa.Text));
        //    LoadGvKhachHang(0);
        //}
        //protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
        //{
        //    if (e.Row.RowType == DataControlRowType.DataRow)
        //    {
        //        foreach (Button button in e.Row.Cells[13].Controls.OfType<Button>())
        //        {
        //            if (button.CommandName == "Delete")
        //            {
        //                button.Attributes["onclick"] = "if(!confirm('Do you want to delete  ?')){ return false; };";
        //            }
        //        }
        //    }
        //}
        #endregion

    }
}